package cn.stylefeng.guns.modular.business.model.params;

import cn.stylefeng.guns.sys.core.util.StringUtils;
import cn.stylefeng.roses.kernel.model.validator.BaseValidatingParam;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
public class OrderParamDTO implements Serializable, BaseValidatingParam {

    private Long ownerUserId;

    private String ownerUser;

    /**
     * 实际金额
     */
    private BigDecimal payAmount;

    /**
     * 提交面值
     */
    private Integer subQuota;

    /**
     * 订单面值
     */
    private Integer itemQuota;

    /**
     * 订单金额
     */
    private BigDecimal amount;

    /**
     * 实际费率
     */
    private Float payRate;

    /**
     * 订单状态0，待审核，1审核成功，待结算2审核失败。3已结算
     */
    private Integer orderStatus;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 是否删除
     */
    private Integer delFlag;

    /**
     * 审核人员id
     */
    private Integer approveUserId;

    /**
     * 审核人员用户名
     */
    private String approveUser;

    /**
     * 备注
     */
    private String remark;


    /**
     * 卡号
     */
    private String cardNo;

    /**
     * 卡密
     */
    private String cardPassword;

    private Long cardCataoryId;

    private String cardCataoryName;

    private Integer cardQuotaId;

    private String cardQuotaName;

    /**
     * 支付金额
     */
    private BigDecimal itemAmount;


    @Override
    public String checkParam() {
        if (StringUtils.isEmpty(this.getCardCataoryId())) {
            return "请选择卡类";
        }
        if (StringUtils.isEmpty(this.getCardQuotaId())){
            return "请选择面值";
        }
        return null;
    }

}
